<template>
  <div class="album-item" @click="$router.push(`/music/albumDetail/${props.albumDetail.id}`)">
    <div class="album-item_cover">
      <img :src="`${props.albumDetail.blurPicUrl}?param=300y300`" alt="" />
    </div>
    <div class="album-item_info">
      <div class="album-item_name show-one-line">{{ props.albumDetail.name }}</div>
      <div class="album-item_detail show-one-line">
        {{ musicTime(props.albumDetail.publishTime) }} 歌曲{{ props.albumDetail.size }}
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import type { IAlbumItem } from "@/types/music/albumType";
import { musicTime } from "@/utils/timeHandler";

const props = defineProps<{
  color: string;
  lightColor: string;
  albumDetail: IAlbumItem;
}>();
</script>

<style scoped lang="scss">
.album-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
  color: v-bind("props.color");
  &_cover {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    margin-right: 20px;
    img {
      width: 100%;
      height: 100%;
      border-radius: 10px;
    }
    &::after {
      position: absolute;
      content: "";
      width: 90%;
      height: 90%;
      top: 4px;
      left: 25%;
      border-radius: 50%;
      background-color: #000;
      z-index: -2;
    }
  }
  &_info {
    flex: 1;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    overflow: hidden;
  }
  &_name {
    font-size: 20px;
  }
  &_detail {
    font-size: 14px;
    color: v-bind("props.lightColor");
  }
}
</style>
